\(\int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx\) [338]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F(-1)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 72 \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=-\frac {\sqrt {2} a \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d}+\sqrt {d} \tan (e+f x)}{\sqrt {2} \sqrt {d \tan (e+f x)}}\right )}{f}+\frac {2 a \sqrt {d \tan (e+f x)}}{f} \]

[Out]

-a*arctanh(1/2*(d^(1/2)+d^(1/2)*tan(f*x+e))*2^(1/2)/(d*tan(f*x+e))^(1/2))*2^(1/2)*d^(1/2)/f+2*a*(d*tan(f*x+e))
^(1/2)/f

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3609, 3613, 214} \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=\frac {2 a \sqrt {d \tan (e+f x)}}{f}-\frac {\sqrt {2} a \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \tan (e+f x)+\sqrt {d}}{\sqrt {2} \sqrt {d \tan (e+f x)}}\right )}{f} \]

[In]

Int[Sqrt[d*Tan[e + f*x]]*(a + a*Tan[e + f*x]),x]

[Out]

-((Sqrt[2]*a*Sqrt[d]*ArcTanh[(Sqrt[d] + Sqrt[d]*Tan[e + f*x])/(Sqrt[2]*Sqrt[d*Tan[e + f*x]])])/f) + (2*a*Sqrt[
d*Tan[e + f*x]])/f

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3613

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2*(d^2/f),
Subst[Int[1/(2*c*d + b*x^2), x], x, (c - d*Tan[e + f*x])/Sqrt[b*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x
] && EqQ[c^2 - d^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {2 a \sqrt {d \tan (e+f x)}}{f}+\int \frac {-a d+a d \tan (e+f x)}{\sqrt {d \tan (e+f x)}} \, dx \\ & = \frac {2 a \sqrt {d \tan (e+f x)}}{f}-\frac {\left (2 a^2 d^2\right ) \text {Subst}\left (\int \frac {1}{-2 a^2 d^2+d x^2} \, dx,x,\frac {-a d-a d \tan (e+f x)}{\sqrt {d \tan (e+f x)}}\right )}{f} \\ & = -\frac {\sqrt {2} a \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d}+\sqrt {d} \tan (e+f x)}{\sqrt {2} \sqrt {d \tan (e+f x)}}\right )}{f}+\frac {2 a \sqrt {d \tan (e+f x)}}{f} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.11 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.28 \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=\frac {(1+i) a \left (\sqrt [4]{-1} \arctan \left ((-1)^{3/4} \sqrt {\tan (e+f x)}\right )-(-1)^{3/4} \text {arctanh}\left ((-1)^{3/4} \sqrt {\tan (e+f x)}\right )+(1-i) \sqrt {\tan (e+f x)}\right ) \sqrt {d \tan (e+f x)}}{f \sqrt {\tan (e+f x)}} \]

[In]

Integrate[Sqrt[d*Tan[e + f*x]]*(a + a*Tan[e + f*x]),x]

[Out]

((1 + I)*a*((-1)^(1/4)*ArcTan[(-1)^(3/4)*Sqrt[Tan[e + f*x]]] - (-1)^(3/4)*ArcTanh[(-1)^(3/4)*Sqrt[Tan[e + f*x]
]] + (1 - I)*Sqrt[Tan[e + f*x]])*Sqrt[d*Tan[e + f*x]])/(f*Sqrt[Tan[e + f*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(286\) vs. \(2(59)=118\).

Time = 0.91 (sec) , antiderivative size = 287, normalized size of antiderivative = 3.99

method result size
parts \(\frac {a d \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 f \left (d^{2}\right )^{\frac {1}{4}}}+\frac {a \left (2 \sqrt {d \tan \left (f x +e \right )}-\frac {\left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4}\right )}{f}\) \(287\)
derivativedivides \(\frac {a \left (2 \sqrt {d \tan \left (f x +e \right )}-2 d \left (\frac {\left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 d}-\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 \left (d^{2}\right )^{\frac {1}{4}}}\right )\right )}{f}\) \(288\)
default \(\frac {a \left (2 \sqrt {d \tan \left (f x +e \right )}-2 d \left (\frac {\left (d^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 d}-\frac {\sqrt {2}\, \left (\ln \left (\frac {d \tan \left (f x +e \right )-\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}{d \tan \left (f x +e \right )+\left (d^{2}\right )^{\frac {1}{4}} \sqrt {d \tan \left (f x +e \right )}\, \sqrt {2}+\sqrt {d^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {d \tan \left (f x +e \right )}}{\left (d^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{8 \left (d^{2}\right )^{\frac {1}{4}}}\right )\right )}{f}\) \(288\)

[In]

int((d*tan(f*x+e))^(1/2)*(a+a*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/4*a/f*d/(d^2)^(1/4)*2^(1/2)*(ln((d*tan(f*x+e)-(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)*2^(1/2)+(d^2)^(1/2))/(d*tan(f
*x+e)+(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)*2^(1/2)+(d^2)^(1/2)))+2*arctan(2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)
+1)-2*arctan(-2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)+1))+a/f*(2*(d*tan(f*x+e))^(1/2)-1/4*(d^2)^(1/4)*2^(1/2)
*(ln((d*tan(f*x+e)+(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)*2^(1/2)+(d^2)^(1/2))/(d*tan(f*x+e)-(d^2)^(1/4)*(d*tan(f*x+
e))^(1/2)*2^(1/2)+(d^2)^(1/2)))+2*arctan(2^(1/2)/(d^2)^(1/4)*(d*tan(f*x+e))^(1/2)+1)-2*arctan(-2^(1/2)/(d^2)^(
1/4)*(d*tan(f*x+e))^(1/2)+1)))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 157, normalized size of antiderivative = 2.18 \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=\left [\frac {\sqrt {2} a \sqrt {d} \log \left (\frac {d \tan \left (f x + e\right )^{2} - 2 \, \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} {\left (\tan \left (f x + e\right ) + 1\right )} + 4 \, d \tan \left (f x + e\right ) + d}{\tan \left (f x + e\right )^{2} + 1}\right ) + 4 \, \sqrt {d \tan \left (f x + e\right )} a}{2 \, f}, \frac {\sqrt {2} a \sqrt {-d} \arctan \left (\frac {\sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {-d} {\left (\tan \left (f x + e\right ) + 1\right )}}{2 \, d \tan \left (f x + e\right )}\right ) + 2 \, \sqrt {d \tan \left (f x + e\right )} a}{f}\right ] \]

[In]

integrate((d*tan(f*x+e))^(1/2)*(a+a*tan(f*x+e)),x, algorithm="fricas")

[Out]

[1/2*(sqrt(2)*a*sqrt(d)*log((d*tan(f*x + e)^2 - 2*sqrt(2)*sqrt(d*tan(f*x + e))*sqrt(d)*(tan(f*x + e) + 1) + 4*
d*tan(f*x + e) + d)/(tan(f*x + e)^2 + 1)) + 4*sqrt(d*tan(f*x + e))*a)/f, (sqrt(2)*a*sqrt(-d)*arctan(1/2*sqrt(2
)*sqrt(d*tan(f*x + e))*sqrt(-d)*(tan(f*x + e) + 1)/(d*tan(f*x + e))) + 2*sqrt(d*tan(f*x + e))*a)/f]

Sympy [F]

\[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=a \left (\int \sqrt {d \tan {\left (e + f x \right )}}\, dx + \int \sqrt {d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}\, dx\right ) \]

[In]

integrate((d*tan(f*x+e))**(1/2)*(a+a*tan(f*x+e)),x)

[Out]

a*(Integral(sqrt(d*tan(e + f*x)), x) + Integral(sqrt(d*tan(e + f*x))*tan(e + f*x), x))

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.40 \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=-\frac {a d^{2} {\left (\frac {\sqrt {2} \log \left (d \tan \left (f x + e\right ) + \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}} - \frac {\sqrt {2} \log \left (d \tan \left (f x + e\right ) - \sqrt {2} \sqrt {d \tan \left (f x + e\right )} \sqrt {d} + d\right )}{\sqrt {d}}\right )} - 4 \, \sqrt {d \tan \left (f x + e\right )} a d}{2 \, d f} \]

[In]

integrate((d*tan(f*x+e))^(1/2)*(a+a*tan(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(a*d^2*(sqrt(2)*log(d*tan(f*x + e) + sqrt(2)*sqrt(d*tan(f*x + e))*sqrt(d) + d)/sqrt(d) - sqrt(2)*log(d*ta
n(f*x + e) - sqrt(2)*sqrt(d*tan(f*x + e))*sqrt(d) + d)/sqrt(d)) - 4*sqrt(d*tan(f*x + e))*a*d)/(d*f)

Giac [F(-1)]

Timed out. \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=\text {Timed out} \]

[In]

integrate((d*tan(f*x+e))^(1/2)*(a+a*tan(f*x+e)),x, algorithm="giac")

[Out]

Timed out

Mupad [B] (verification not implemented)

Time = 5.45 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.74 \[ \int \sqrt {d \tan (e+f x)} (a+a \tan (e+f x)) \, dx=\frac {2\,a\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{f}+\frac {{\left (-1\right )}^{1/4}\,a\,\sqrt {d}\,\left (\mathrm {atan}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{\sqrt {d}}\right )-\mathrm {atanh}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{\sqrt {d}}\right )\right )}{f}+\frac {{\left (-1\right )}^{1/4}\,a\,\sqrt {d}\,\mathrm {atan}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{\sqrt {d}}\right )\,1{}\mathrm {i}}{f}+\frac {{\left (-1\right )}^{1/4}\,a\,\sqrt {d}\,\mathrm {atanh}\left (\frac {{\left (-1\right )}^{1/4}\,\sqrt {d\,\mathrm {tan}\left (e+f\,x\right )}}{\sqrt {d}}\right )\,1{}\mathrm {i}}{f} \]

[In]

int((d*tan(e + f*x))^(1/2)*(a + a*tan(e + f*x)),x)

[Out]

(2*a*(d*tan(e + f*x))^(1/2))/f + ((-1)^(1/4)*a*d^(1/2)*atan(((-1)^(1/4)*(d*tan(e + f*x))^(1/2))/d^(1/2))*1i)/f
 + ((-1)^(1/4)*a*d^(1/2)*atanh(((-1)^(1/4)*(d*tan(e + f*x))^(1/2))/d^(1/2))*1i)/f + ((-1)^(1/4)*a*d^(1/2)*(ata
n(((-1)^(1/4)*(d*tan(e + f*x))^(1/2))/d^(1/2)) - atanh(((-1)^(1/4)*(d*tan(e + f*x))^(1/2))/d^(1/2))))/f